package com.keyware.utils.keycloud;

import java.io.IOException;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

public class Base64Util {

	public static byte[] encodeToByte(byte[] byt){
		return new BASE64Encoder().encode(byt).getBytes();
	}
	public static byte[] decode(byte[] byt){
		byte[] decodeBuffer = null;
		try {
			decodeBuffer = new BASE64Decoder().decodeBuffer(new String(byt));
		} catch (IOException e) {
			e.printStackTrace();
		}
		return decodeBuffer;
	}
}
